Skip to main content

Full text of "dg :: software :: lang :: 093-000040-00 ExtendedAssembler 1969"

See other formats


DMA GENERAL 
CORPORATION 

Southboro, 

Massachusetts 01 772 

(617)485-9100 



FPQCRAI'-l 

Tj-.PES 
Absolute Binary: 091 --000017 

ABSTRACT 



The extended assembler, like the basic assembler, converts symbolic assembly 
statements into machine language code. In additii^n to basic assembler features 
the extended assembler provides relocation, interprogran communication, condi- 
tional assembly and more powerful nimber definition facilities. 



Copyright (C) Data General Corp., I969 093-OOOOi+O-OO 

Printed in U.S.A. 



EXTENDED ASSEMBLER 

The extended assembler differs from the bftsic assembler in four respects: 
l) Relooatability - programs can be assembled so that they may be loaded by the 
relocatable loader; 2) Inter-program communication - programs can be assembled 
which reference data, instructions , and addresses defined in other programs or 
vice-versa (argument swapping or .sharing) : 3) Numkev definition - simpler 
methods for specifying double precision, decimal and floating point constants 
as well as bit boundary aligmnent of constants are provided, k) Conditional 

on the basis of an absolute expression evaluating to zero. 

Except for these added features the extended assembler is identical to and 
compatible with the. basic assembler, end a knowledge of the basic assem.bler 
(see write-up O93-.00OO1T) is a prerequisite in the following discussion. The 
extended assembler is also compatible with the basic to the extent that programs 
not using the relocatable or interprogrnm communication facilities {ie with no 
occurrence of one of the pseudo-ops: .ZREL, .IJREL, .TITL, .ENT, .EXTK, or .EXTD) 
will be assemblc'd as absolute and the binarv taiDe will be punched in the same 
format as the output of the basic assembler for loading by the absolute binary 
loader. 

Use of the relocation and interprogram communication facilities requires 
deferment of final address assignment until load time thus leaving this task 
to the relocatable loader. It is not surprising then that the relocatable 
loader (see write-up 093-000039) is a more sophisticated program than the absolute 
binary loader and that the data passed to it by the extended assembler differs 
from the output of the basic assembler passed to the absolute binary loader. 

Together the extended assembler and relocatable loader provide a package 
that enables the programmer to work separately on subprograms in the coding, 



-2- 

debugging and testing phases without worrying about the absolute location of 
a given progrfiri or the absolute locations of data and addresses nha\'tjfl by 
programs at run-time. 

PELOCATION 

In addition to the assembly of absolute code the user may use the extended 
assembler to produce two types of relocatable code. Those types will be i-eferii.-d 
to as sero relocatable and normal relocatable. 

Storage words that may be relocated but must reside in page zero should be 
assembled as zero relocato.ble using the zero relocatable mode. ITie user informs 
the assembler that a body of code is to be zero relocatable by preceding it with 
the pseudo-op .ZREL. Likewise, storage words that may be relocated anywhere 
except page zero must be assembled as normal relocatable in normal relocatable 
mode. The user indicates this by preceding his normally relocatable code with 
the pseudo-op .NREL. 

The extended assembler initially assumes assembly mode to bo absolute and 
continues to assemble in this mode until it encounters an occurrence of either 
.ZREL or .NREL in the user's code. The user may enter zero relocatable or 
norm.8l relocatable mode at any point in his program simply by issuing a .ZREL 
or .NREL pseudo-op and the assembler will pick up the assembly at the next 
unused zero relocatable or normal relocatable address. Also, having once entered 
one of the relocatable modes with a .ZHEL or .NREL pseudo-op and having defined 
symbols in that mode, the .LOG pseudo-op with an expression containing a 
previously defined symbol or synbols may be used to reenter that mode. The type 
of the expression determines the mode entered. Thus, when the expression used 
in the pseudo-op evaluates to a zero relocatable value the zero relocatable 
mode is entered and the zero relocatable relative location counter is set to 
the next unused zero relocatable address or to the value of the expression if 



it is higher. Likewise, when the expression evaluates as either norinnl r-^lo.-a- 
table or absolute, the normal relocatable relative location counter or the 
absolute location counter is set. At no time, however, may the .LOG pseudo-op 
be used to move either of the two relative location counters or the absolute 
location counter backwards, since this would create the possibility of overwr.it,-inf!: 
portions of the preceding code which is not permitted by the relocatable loader. 
The . used in an expression associated with the .LOG pseudo-op has the meanings: 
"current absolute address", "current normal relative address'", and '"current page 
zero relative address" when used within absolute, normal relocatable, and page 
zero relocatable code respectively. The following statements provide examples 
of the use of these pseudo-ops. 



-k- 



00000 000000 
OOOCl 000000 

0000 S 7 
00027 000170 A I 
00030 000113 Bt 

000074 

000020 TABLI 



OOOOO-OOaSlO PNTRl 
00001-000000' PNTRl t 

000007- 
00007-000000 ARQlI 

000 377 
00377 000000 ARQ2I 



00000 '082027 MAINt 
00001*024030 

000010- 
00010-010074 

00011-020006 

003510 

03510 024007- SUBRTt 

03511 030377 

03512 010400 

000006* 
00006*052027 







•LOC 27 

2*TABL 

TABL+17, 

•LOC .♦43 

•BLK 20 

.ZREL 
SUBRT 
MAIN 
«LOC •♦S 




•LOC ARGl-PNTH+370 





.NREL 
LM 0*eA 

LDA 1*B 



J ABSOLUTE 

lADJUST ABS LOC COUNTER 

I ADJUST ABS LOC COUNTER 

I ZERO RELOCATABLE 

lADJUST EREL LOC COUNTER 

I ABSOLUTE 

IHOR^IAL RELOCATABLE 



.LOC AP31+J 
ISS TAEL 
.LOC PP^TR1*8 
LDA 0#ARGS-PNTni 

.LOC 3510 
LDA IfAKGI 
LDA 2«ARQe 
•LOC 3500 
ISZ SUBRT*8 

.LOC HAIN«6 
STA 8#«A 



tZEJtO RELOCATABLE 

J LOC COUNTER CAfl'T GO BACK 

I ABSOLUTE AGAIN 

J LOC COUNTER CAN'T 60 BACK 

} NORMAL RELOCATABLE 



>END 



-5- 

The assembler will begin assembly in absolute mode and will create two 
data words containing zeros for locations 00000 and 00001, then the .LOG 
pseudo-op with the absolute expression 27 will change the location counter to 
27g and the next two data statements will create two data words which at run 
time will contain respectively a byte pointer to the table called TABL, and 
the address of the end of the table. The next two statements increment the 
location counter l+3g times and reserve 20g locations to store the table. The 
.ZREL pseudo-op causes the assembler to shift from 'absolute to zero-relooatable 
mode, and the next two statements, which will be assigned zero relocatable 
relative addresses 00000 and 00001, reserve words which are loaded with the 
relative addresses of routines SUBRT and VAUi. ARGl is assigned zero reloca- 
table relative address 00007 since the .+5 expression used in the .LOG pseudo-op 
increments the zero relocatable location counter by five. AP.G2 is assigned 
absolute address 377g since the expression ARGl-PNTR + 370 from the preceding 
•LOG pseudo-op evaluates to an absolute value thus shifting the assembler into 
absolute mode. The .NREL then shifts the assembler into normal relocatable mode 
and proceeds to assemble the routine MAIN starting at the normal relocatable 
relative address 00000. But, because when evaluated the expression ARGl+1 in 
the next .LOG pseudo-op is zero relocatable, the assembler then retvirns to zero 
relocatable mode. Note that the instruction ISZ TABL which follows this .LOG 
is assigned page zero relocatable address lOg which is both the value of the 
expression ARGl+1 and the next available \mused page zero relocatable address. 
Hence, exactly the same result could have been obtained by replacing the 
.LOG ARGl+1 statement with a simpler .ZREL statement. In practice this would 
be the most usual way of assigning the subsequent statement the next available 
relocatable address. The expression PNTRl+2 in the next .LOG pseudo-op is zero 
relocatable hence the assembly node remains unchanged, but because the expression 
evaluates to page zero relocatable address 00003 which has already been used the 



-6- 

pseudo-op receives an L flag and the subsequent statement is assigned page zero 
relocatable address 00011 which is the next available page zero relative loca- 
tion. The .LOG 3510 shifts the assembler back to absolute mode, but the .LOG 350n 
although keeping the assembler in absolute mode is given an L flag since in order 
to complete the command the assembler would have to turn back the absolute loca- 
tion counter. 

Expression Evaluation 

The extended assembler allows expressions using relocatable symbols, but 
certain restrictions should be kept in mind when constructing them: 

1) Expressions using both page zero and normal relocatable symbols must be 
such that either the page zero cr the normal symbols cancel out. Thus for 
example, expressions of the form Z, + N, - Zp + Ng - N^ are legal, where the Zs 
represent page zero relocatable symbols and the Ns normally relocatable symbols. 

2) Expressions that evaluate to twice a relocatable symbol or the sum of two 
like relocatable symbols are permitted in data statements but those that will 
evaluate to higher multiples or non-integer multiples of relocatable symbols 

are illegal. 3) Externally defined syrabols (relocatable or absolute), op codes, 
double precision, and floating point numbers arc all unuseable in expressions. 

The last point is straightforward, but the first two require consideration 
of the loading process to be understood. During loading the loader must add a 
constant K, to each N^ and a constant Y.,^ to each Z^ in the program it is loading 
to determine the absolute addresses of the symbols in the loaded program. It 
also must modify the contents of each storage word appropriately which it does 
by adding one and only one of five possible constants to the word (0,K, ,Kp,2K, , 
or 2Ko). From this one can see that expressions that mix page zero and normal 
relocatable symbols without one or the other cancelling will not be allowed. 
/Iso one can see that loader modification of address contents by more than twice 
a relocatable base is not permitted. At this point it is important to see why 



-7- 

expressions evaluating to tvice a relocatable symbol are permiLtori. rrobnMy 
the most coraman use for expressions of this kind is in the creation of byte 
pointers in data statements for use by input/output routines that process 8 bit 
bytes. This is discussed on page 2-21 of Hov to Use the Nova , but breifly, a 
byte pointer is a storage word in which bits 0-1 1| contains an address and bit 15 
specifies which half of the word addressed is to be worked on. Clearly, a byte 
pointer of this kind can be formed by simply doubling an address, and can be 
retrieved and regenerated by a simple shifting operation. It should be 
remembered that this is a convenient software convention and is not a hardware 
function. We shall use the terms byte pointer type relocatable or byte 
reioaataui^e to describe expressions of this kind. 

It is also important to stress here that these byte pointer type relocatable 
expressions are only permissable in dpta statements and are not acceptable as 
addresses in memory reference instructions , Expressions used in the address 
portion of mem.ory reference instructions must evaluate to be absolute, page zero 
relocatable or normal relocatable. 

Specifically, expressions of the following forms or which can be reduced 
to these forms are acceptable to the extended assembler and produce values having 
the properties stated. 

Expression Attribute of Evaluated Result 
A+A Absolute 

R-R Absolute . * ' , 

r T 

R±A Relocatable 

R+R Byte Relocatable 

2»R Byte Relocatable 

Expressions that cannot be evaluated to be absolute, relocatable, or byte 
pointer type -relocatable, as well as those that illegally mix page zero and 
normal relocatable symbols will receive R error flags . 



-8- 

As part of the assembly listing the extended asseinbler prints the address 
assigned (absolute or relative) and the contents (before load time) of each 
storage word generated by the assembler from the programmer's source code. In 
the listings it flags each address to indicate in what way that storage word mey 
or may not be relocated, and flags the contents of the address to indicate hov 
they will be affected in relocation. These flags will be printed adjacent to 
and to the right of these octal fields on the listing. The flags are: 
Address Flags Meaning 

blank Address of word is absolute. 

Address of word is page zero relocatable. 
' Address of word is normally relocatable. 



Content's Flacs 



blank 



Meaning 
Contents of word arc absolute. 
Contents of word are page zero relocatable. 
Contents of word are page zero byte relocatable. 
Contents of word are normally relocatable. 
Contents of word are normally byte relocatable. 
Storage word references a displacement external. 



These flags can be seen in the previous example and in the following. 



_0- 



0000 10 

000 10 000006 At 

00011 000000 



•EXTD PISP 

•LOC 10 

6 





H 
R 
R 
R 
R 
R 
A 



00001 
00002 
00003 
00004 
00005 
C0006 
C0007 
00010 
000 1 1 
00012 



000001- 
-OOO/iOO 
•00000 1- 
'OOOOOil* 
'000005- 
'•034002- 
•031525 
•044000 
"00000 1 • 
'000002" 
-020001$ 



aoooo 

0000 I 
00002 
00003 
00004 
00005 
00006 
00007 
00010 
00011 
00012 
00013 
00014 
00015 

00416 
00417 
00420 
00421 



Bt 
Ct 
Dt 



•000010 
•000000' 
•OOOCOO" 
•000401 
•034775 
•031525 
•044003- 
•000000 
•000000 
•000000 
•000000 
•000000 
•000000 
•020000 
000416* 
•020402 
•000002- 
•000004- 
•04000 IS 



000013- 
00013-010000 
00014-010006- 
00015-000006- 

000427 • 
00427*014000 
00430^0 14575 
00431* 00 145fi*' 
00432*034000 
00433*010000 
00434*050000 
00435*000000 



Xt 



El 
Ft 

Gt 



Ht 
It 



Jl 



Yt 



• ZFSL 

• LOC 
400 
B 

C+C 
*«P 
LDA 
LDA 
STA 
F 
^♦F 

LDA 0*DISP 



♦ 1 



.♦1 
3»C 

2«125«3 
1*G 



JCONTENTS ABSOLUTE 

I CONTENTS PZ RELOCATABLE 

J CONTENTS P2 BYTE REL. 



I ADDRESS OUTSIDE PAGE ZERO 
JCOHTENTS NORM RELOCATAWE 
IG0NTENT5 WORM BYTE REL. 
;ADDa IS DISPLACEMENT EXTERNAL 



.riRSL 

A 

E 

E*E 

Ji.P 

LDA 

LDA 

STA 1 

E+E+E 

5*F 

5*F/'2 

4*F/3 

2*F/3 

C+F 

LDA 

.LOC 

LDA 

C 

C*C 

STA 



; CONTENTS ABSOLUTE 
I CONTENTS KOHM RELOCATABLE 
I CONTENTS NORM BYTE REL. 
♦ 1' 
.F 

*185#3 
»U 

I EXPRESS I ON NOT ABS# REL* OR BYTE REL. 
iDITTO 
JDiT'iO 
JDITTO 
I DITTO 

) UNCANCELLED MIX OF PZ & VREL SYMBOLS 
#2«Y+G-E-Z TERROR ~ « -gOO*APUKES5>.* 1 77 



.♦400 
*S*Y*G-E-Z 



«DISP 



JMPI 



•LOC «*3 
ISZ 3#W*D/2 
ISZ 3*W*D/4 
3*tf*D/4 

•LOC Z+7 

DSZ 4*y-F-Z*C 

DSZ 4*Y-F-Z*C 

4*Y-F-Z»C-D 

LDA 3#0I5P«6 

ISZ JMP*4 

STA 2«6D«3 

2.0*Z 





;0.K. - •-200«-AnDRESS<.*177 

j CONTENTS PZ RELOCATABLE 

I CONTENTS PZ BYTE REL. 

lADDR IS DICPLACEHENT EXTERNAL 

JZERO RELOCATABLE 
i ERROR - A DDR tS P2 BYTE REL- 
10. K. - ABDR IS PZ RELOCATABLE 
ICONTENTS PZ PYTE REL. 



If^ORHAL RELOCATABLE 
•D I ERROR - ADPR IS NORH BYTE RSL. 
>D/8 I O.K. - ADDR IS t<iQfU^ REL 
I CANCELLED MIX OF PZ A N REL SYK 
IEXTErJ«AL USED IN EXPRESSION 
I OP CODS lf5ED IN E.*:PRESSION 
lEOUB PREC # USED IN EXPR. 
IFLTG PUT ♦ USED IN EXPR. 
lOP COP£ USED AS SYMBOL 



>END 



-10- 

The example above also shews three types of error flags: the 'R', the 'A', 
ajid the 'Z'. The 'R' flag, as has been mentioned before, is used to flag 
expressions that cannot be evaluated to be absolute, relocatable or byte pointer 
type relocatable, or which mix paye zero and normal relocatable symbols in e non- 
cancellinr- fashion. 

The 'A' flag plays much the same role as it does in the absolute assembler 
indicatinf address errors. That is, when memory vefercnce instnictions (JMP, 
JSR, ISZ, DSZ, LDA, & STA) that are to be pa^e zero relocatable reference 
addresses outside page zero, or when those that are to be normally relocatable 
reference addresses outside the range of location counter relative addressing 
(.-200 <_ address <_ .+1TT), or vrhcn an expression used to specify an address does 
not evaluate to an acceptable absolute, page zero relocatable, or normal reloca- 
table address, the statements will be flan-re'' vith an 'A' and an absolute address 
of 00000 will be substituted by the assembler. Expressions used in data state- 
ments are not restricted in the addresses they reference a,nd hence when assembled 
may contain byte relocatable as well as absolute or ordinary relocatable data. 

The 'Z' flag is generated whenever a statement contaJ.ns an expression that 
uses symbo3.s not evaluable by the assembler. These expressions containing 
externals, op codes, double precision numbers, and floating point numbers will 
receive 'Z' flags. 

INTS2PR0GFAM Cd^'MUNICATION 

It is possible using the extended assembler to reference data, addresses 
and constants in a program which are not defined within that program but rather 
in others , and it is also possible to make symbols defined within that program 
available to other programs by preceding the program code with pseudo-ops 
declaring the appropriate symbols as either externals or entries. Note that 
although a symbol may be used in many programs to reference some datum, address 



-11- 

or constant, it can only te defined in one program without being multiply <le fined. 
Hence, within a suite of programs a symbol may be declared as an external by 
several programs but should be declared as an entry in only one program. 

Two types of externals may be specified using the extended assembler. 
They will be referred to as normal exter>nals and displaaement externals (or 
external displacements) . Displacement externals may be used in any memory 
reference instruction or data statement, but when evaluated by the assembler 
must resolve to a value representable in eight binary digits. That is, when 
used in a data statement or in a memoiy reference instruction with index = 00 
(referring to page zero) the displacement must resolve to a value in the range 
^1^1. 3T7:. when used in a memory reference instruction with index ^ 00 
(addressing relative to the location counter or relative to a tase address con- 
tained in AC2 or AC3) the displacement must fall in the range of permissable 
displacements -200 <. D j^ 177. Normal externals are pcnnissable only in data 
statements, te , an entire storage word must be reserved for a normal external. 

Two pseudo-ops are used to declare symbols that will be used as normal 
externals or displacement externals. The pseudo-op used to declare normal 
externals has the form 

.SXTN SI, S2 ... 
where SI, S2 represent the symbolic names of the normal externals. These 
symbols must conform with the rules for symbol definition applicable to all 
other symbols. At least one symbol must be specified, but any number may appear 
if separated by spaces or commas. The pseudo-op for declaring displacement 
externals has the same form 

.EXTD SI, S2 ... 
where SI, S2 represent the names of the displacement externals. Every external 
must be declared in some other program as an entry by means of the entry pseudo- 
op which has the form 

.ENT SI, S2 ... 



-12- 

where SI, S2 represent symbols /lefined within the current procrajn. Programs 
vhich use externals or define entries rust declare the relevant symbols in the 
•EKT, ,EXTN, OR .EXTD pscudc-ops before any ether statements. The order, how- 
ever, in which these three pseudo-ops appear is immaterial. Any errors that 
occur in the declaration of internal or external symbols are indicated by 
flagging the statement with a C- flag. 

Since titles are key identifying elements required by the symbolic debugger 
and library file editor used in conjunction with the extended assembler,, a 
pseudo-op for naming progrsuns is provided. This statem.ent takes the form 

.TITL title 
where title represents a legitimate syi-ibol which becomes the pro,;-ram name. This 
symbol m.ay conflict with any other symbol without causing an error, since this 
symbol is im.plicitly different from all others. However, if the title violates 
the rules for sym.bol definition, the statement will receive a G flag. If no 
.TITL statement is included in'a program, the assembler assumes the title .FJ'JN, 
and this will be the symbol Dunched in the title block (see Appendix A). The 
.TITL statement must appear before any statement that penera-tes object data. 
If a second .TITL appears before a data statement, the first title is replaced 
by the second. 

Tlie example that follows illustrates use of the external, entry, and title 
facilities . 



.TITL 



REP US 







•ENT BGNjCCHLFj.CRLF 






.EXTN CRLK#TYPET 






.EXTD C377*D0NE 






• ZREL 


00000-001764" 


CSTRt 


STRING+STRING 


00001-001776" 


CSTHlJ 


STHING+STRING+IS 


000001 


PPJTHt 


eBLK 1 


00003-1 7? ?77 


•CRLFS 


CKLF 


O0004-005015 


CCRLFl 


5015 
• NRSL 


00000 '006003- 


BGNI 


JER ••CRLF 


00001 •020001- 




LDA C»CSTR1 


00002 •0/J0002- 




STA 0*PNTR 


00003*030002- 


LOOPI 


LDA 2*PNTH 


0000 -U '01 4002 - 




hSZ PNIH 


00005*024000- 




LDA 1..C5TR 


00006*132433 




sua2# i*a/SNc 


00007*000002$ 




JWP DOK£ 


00010*151220 




MCV2R S»2 


0001 I 'OglOOO 




LLA 0*0.^3 


00012*02400 1$ 


■■ 


LDA Ji.C377 


00013*101002 




f^oy o*o»s;^c 


00014*101300 




M0V5 0»0 


00015*123400 




AND 1*0 


00016*177777 




TYPET 


00017*000764 




JMP LOOP 


00020*0601 11 


INITt 


NIOS TTO 


00021 *000757 




JMP BGN 


000772* 




•LOG .*750 


00772*040440 


STRING! 


•TXT ♦ A 


00773*047526 


VO 




00774*020116 


N 




00775*042522 


RE 




00776*052520 


PU 




00777*020123 


S 




01000*000000 


i$- 




000020 * 




.END INIT 



-Ik- 







•TITL AVON 






•EXTD CCRLF#.CRLF 






.EKXrJ BGN 






•ENT C 377 • DONE* TyPET*CHLF 






.zaf;L 


00000-000377 


C377I 


377 


00001-000007* 


.TTTOl 


TTTO 


00002-177777 


.BOHl 


BrSN 


00003-006002* 


DONEt 


J5H ©.CRLF 


00004-063077 




HALT 


00005-008002- 




JKP O.BGN 


006001- 


TYPET* 


JSR e.TTTO 


00000*0 54 A.p6 


CRLFl 


STA 3#RC!ILF 


00001*020001$ 




LDA 0*CC1LF 


00002*006001- 




TYPET 


00003*101300 




MOVS 0#0 


00004*006001- 




TYPET 


00005*002401 




J^;P CRCKLF 


000001 


P.CBLFl 


.BLK 1 


00007*063611 


TTTO» 


SKPDN TTO 


00010*000777 




JKP .-i 


00011*061111 




DOAS 0*YTO 


00012*001400 




JI^P 0#3 

'.-.END 



NUMBER DEFINITION 

The niffiiber defining capability of the extended assembler has been expanded 
considerably over that of the basic assembler, xne imprcvemcnts help the user 
interface more easily with Data General's math library and floating point 
interpreter. 

Dccirngl 

To input deciinal numbers usini~ the basic assembler, it was first necessary 
to declare 

.RDX 10 
In addition to the ,RDX ps^udc-op the extended assembler allows the user 
to specify a decimal number at any point in his program by terminating a niimeral 
string with a decimal point. PIcvcVcr, no numeral may follow the decimal point 
without the number being interpreted as floatir;? point. For example, in any 
radix, 10. will be interpreted as decimal 10 and be converted to octal 12 
whereas 10.0 will be interpreted as a decimal floating point number. The decimal 
defining featiire allows the programmer to combine decimal numbers in expressions 
with numbers of other radices. The following illustrates this. 

Assembl ed Storage Uord Program Code 

.RDX 2 
000152 101 + 101. 

.P.DX 8 
0002il6 101 + 101. 

.PCX 10 
000312 101 + 101. 

Floating Point 

If a numeral string is followed by an 'E' or if the niimeral string contains 
a decimal point followed by at least one m.ore numxral or the letter 'E' the 
extended assembler will interpret the string as a floating point number. It 
will convert the string to a two word, floating point constant using the binary 



-16- 

fraction representation discussed in Appendix C of Hov to Use the Hova . This 
format is the one used by Cata Generfil's floating point interpreter (see write- 
up 093-0000.19). If numbers too Ip.rtrc or too small to be represented are specified 
the assembler will recard them as errors and flafr them with an N flag. 

The followin.7 examples illustrate the definition of floating point 
constants . 

Assembled Storage Words Pro/?ram Code 

01+0H20 1.0 

000000 

Ol+0)i26 3.1^15926 

1+1 766 

l!40U20 -lEO 

000000 

0)i0200 +5.OE-I 

000000 

The number following the 'E' is the decimal power of ton used to evaluate 

the number. The last example therefore implies 

+ (5.0)*(10)~''" = +0.5 

Note: Although floating point constants may be used in data statements they 
are not permitted in expressions. 

Double Precision 

The math library provides for extensive manipulation of double precision 
numbers. These numbers are represented usinr: two contiguous memory words (or 
two hardware accumulators) concatenated into a 32-bit string where the first word 
comprises bits to 15 of the number and the second word bits lo to 31 of the 
number . 

15 16 31 



I word 1 ! word 2 



-17- 
Bit contains the sign and bits 1 to 31 contain the magniturlo in two's 
conplenent notation. Double precision constants can be defined using the 
extended assembler by terminating a numeral string with a D. The numeral string, 
which may be signed, is then evaluated in the current radix, but as with single 
precision number definition no check is made for arithmetic overflow. The 
following strings convert as shown (assuming radix 8). 

Assembled Storage Words Program Code 

000000 ID 
000001 

177777 -ID 

rr r-r ry t^ t~r r-r 

1 I I ( I t 

000001 200000D 

000000 

Note: Double precision numbers cannot be combined in expressions. 

It is also possible to specif;/- double precision decimal numbers at any 
point in a program by using the decimal point followed by a 'D' , but as with 
all double precision numbers the^y may not be combined in expressions. For 
example , 



OOOOOH 262lii7.D 

000003 

000001 100000. D 

1032it0 

Bit Boundary Alignment 

A facility for right Justification of a single precision integer on a bit 
boundary is provided in the extended assembler. The specification of an integer 
in the current radix followed by 

B decimal nvmber 
will cause the binary equivalent of the integer to be aligned at the bit boundary 



—18- 

designed by the decimal number. Thus the decimal number is limited to the 
range to 15. The statement takes the form 

n B d 
where n is a number in the current radix (usually octal) and d is a decimal 

number specifying the bit boundary. The number is given the value 

, . , s (15-d) 
(n) H2) 
r 10 

vhere r represents the current radix. The following strings are converted 

as shown (radix 8). 

Assembled Word (Binary) Pro^rajm Code 

1 000 000 000 000 000 IBO 

000 000 000 000 010 1B11+ 

000 010 100 000 000 12B3 

CONDITIOUAL ASSEMBLY 

The extended assembler provides a conditional assembly feature which allows 
portions of a progrnm to be assembled or to be by-passed by the assembler on the 
basis of the evaluation of absolute expressions. Three pseudo-ops are used to 
control the conditional assembly feature. They have the form 

.IFE Expreosion (or .IFTI Expression) 

.EIJDC 
The expression in the .IFE (or .IFN) pseudo-op must be evaluable in pass 1 of 
the assembly process. Otherwise it will be regarded as an error and flagged 
with a K flag. That is, all symbols used in the expression must be absolute and 
defined previous to the occurrence of the .IFE. If, when evaluated, the 
expression equals zero, the statements following the .IFE will be assembled, 
but when the evaluated expression does not equal zero all statements subsequent 
to the .IFE pseudo-op up to the occurrence of an end conditional pseudo-op (.ENDC) 



will be ignored. It is possible to specify the opposite situation by using the 

• IFN pseudo-op with an expression. Wion using the .IFN pseudo-op subBo>in--nt 

statements will be assembled only if the evaluated expression does not equal 

zero, and will be by-passed when the expression equals zero. 

Two further points should be kept in mind when using the conditional 

assenbly feature: l) Conditionals nay not be nested, ie, if a second .IF 

pseudo-op is encountered before an .EKDC pseudo-op is found, the second .IF 

will be ignored and vrill receive a K flag. 2) The pseudo-ops .EI'ID and .EOT 

vjilX not be i'^nored when imbedded in a section of conditionall""" assfinibled 

code, ie, in the following excjnple the .ETJD will not be bypassed but will cause 

the assembler to cease the assembly process. 

.IFE 1 

.END 

.LNPC 



iJ'PENDIX A 
Operating Procedure 

The procedure used in ass entiling source cede V7ith the extended asseinbler 
is identical to that used with the basic assembler. However, two additional 
options for specifying the punched binary output are provided. Tluaae options 
cause the table of local s^/mbols generatc-d during assembly to be included in 
the punched output, This table of local synbols should be output only when 
the procrai^jner intends to dobur; his profTrom using the symbolic dcbu(reer since 
the binary tapes without local Dyrnbols are considerably shorter. 

Thus, when the assembler asks what form the binary output is to take, by 
typing , 

BIN ; 
there are four possible responses whoce effects are shown below. 

RESPONSE EFFECT 

1 Output binary on the teletype without loc<al symbols . 

2 Output binary on the high speed punch without local symbols. 

3 Output binary on the teletype with local symbols. 

U Output binary on the high speed punch with local sym.bols . 

Like the basic assembler, the exteadc^d assembler punches its output in 
blocks separated by null characters . There are seven different types of 
blocks punched by the extended assembler which are distinrniished by the code 
contained in the first word of each block. There is a specific order in which 
these various types are punched with all blocks of one type being punched together. 
For each pronirani assembled the extended assembler will punch a Title Block, a 
Start Block, and at least one other block, b\at aside from the Title and Start 
Blocks no other type of block must necessarily appear in every program. The 
seven types of blocks in the order in which they would be punched if all were 
required are shown on the next page. The exact formats of each of these blocks 
can be found in Appendix C of the Relocatable Loader write-up (093-000039). 



Order of Blocks Punched in Paper Tape 




TITLE BLOCK 



/■/ / / /T / / // / //7T^ 



:iTTr:Y blocks (s) 



rZ~/7~7"/ / / / / / / / T77 



DISFLACETIENT EXTERNAL 
Br)CK(S) 



1^LJ..JU ^ ' / / / / I / FTi 



RELOCATABLE DATA 
BLOCK(S) 



n / / / /I/ / ' / / / W? 



NORWi EXTERNAL 
BLOCK(S) 



/ /' / '' / / / / / / / / ■■' / 7 / 



LOCi^i SYMBOL 
BLOCK(S) 



^ //////////// / / / 



START BLOCK 




APPENDIX B 
Error Mnemonics 

UJ£\ PffAi'TING 

A Address error - Expression evaluates to something other than an 
absolute, normal relocatable, or page zero relocatable address. 
Page zero relocatable instruction references address outside page 
zero. Normally relocatable instruction references address outside 
the range of location counter relative addressing, 

G Error in declaration of an internal or external symbol. 

K Conditional assembly error - Expression used in .IFE or .IFU 
pseudo-ops is not evaluable in pass 1, or the .IFE or ,IFN 
pseudo-op is nested within a previous conditional assembly 
statement. 



Number specified is too lar^e or too small to be represented as 
a floating point nuraber. 



Expression error - Expression does not evaluate to be absolute, 
relocatable, or byte pointer type relocatable, or expression 
mixes paf-e zero and normal relocatable symbols incorz-ectly. 



Expression contains illegal symbol, (eg, an external, an op code, 
double precision number, or floating point mmbsr).